@echo off
echo ===== 开始生成JaCoCo测试覆盖率报告 =====

echo 1. 调用登录接口测试...
curl -X POST http://localhost:8080/api/users/login -H "Content-Type: application/json" -d "{\"username\":\"admin\",\"password\":\"admin123\"}"
echo.

echo 2. 调用注册接口测试...
curl -X POST http://localhost:8080/api/users/register -H "Content-Type: application/json" -d "{\"username\":\"newuser%random%\",\"password\":\"password123\"}"
echo.

echo 3. 正常关闭应用程序...
curl -X POST http://localhost:8080/actuator/shutdown
echo.
timeout /t 5

echo 4. 生成JaCoCo报告...
call mvnw.cmd jacoco:report

echo 5. 打开JaCoCo报告...
start "" "target\site\jacoco\index.html"

echo ===== JaCoCo测试覆盖率报告生成完成 =====